/**
 * @typedef UpdateRecommend
 * @property {integer} xmindId.required
 * @property {integer} recommend.required
 */

const express = require('express')
const router = express.Router()
const auth = require('@/middleware/auth.middleware')
const xmindController = require('@/controllers/xmind.controller')

/**
 * 思维导图列表分页查询
 * @route GET /xmind
 * @summary 思维导图列表分页查询
 * @group 思维导图管理
 * @param {string} pageNo.query.required
 * @param {string} pageSize.query.required
 * @param {string} searchKeywords.query 搜索关键字
 * @returns {object} 200
 * @returns {Error}  default - Unexpected error
 * @access xmind-permission:btn:find
 * @security JWT
 */
router.get('/', auth(), xmindController.findPage)

/**
 * 是否推荐思维导图
 * @route POST /xmind/update-recommend
 * @summary 是否推荐思维导图
 * @group 思维导图管理
 * @param {UpdateRecommend.model} UpdateRecommend.body.required
 * @returns {object} 200
 * @returns {Error}  default - Unexpected error
 * @access xmind-permission:btn:recommend
 * @security JWT
 */
router.post('/update-recommend', auth(), xmindController.updateRecommend)

module.exports = router
